
username = 'mayun'
password = 'alibaba'

flag = True
count = 0
while flag:
    if count <= 3:
        name = input("请输入用户名：")
        pwd= input("请输入密码：")
        if name == username and password == pwd:
            print("欢迎你 %s 登录成功" % name)
        else:
            print("用户名或者密码错误！")
        count += 1
    else:
        print("输入错误达到三次，自动退出！")
        flag = False



